<script>
	$(document).ready(function (){
		$("#txtnacimiento").dynDateTime({
			showsTime: false,
	  		ifFormat: "%Y-%m-%d"
		});
		
	});

	function validar_formulario(){
		var user_name = $('#txtuser_name').val();
		var password = $('#txtpassword').val();
		var password2 = $('#txtpassword2').val();
		var correo = $('#txtcorreo').val();
		var nombre = $('#txtnombre').val();
		var apellido = $('#txtapellido').val();
		
		if(user_name==''){
			alert('Debe ingresar Nombre de usuario');
			return false;
		}else{
			if(password==''){
				alert('Ingresar Password');
				return false;	
			}else{
				if(password!=password2){
					alert('No coincide ambos passwords');
					return false;	
				}else{
					if(correo==''){
						alert('Ingresar Correo');
						return false;	
					}else{
						if(nombre==''){
							alert('Ingresar Nombres de Estudiante');
							return false;	
						}else{
							if(apellido==''){
								alert('Ingresar Apellidos de Estudiante');
								return false;
							}	
						}
					}
				}
			}
		}
	}
</script>
<div style="border-bottom:#CCC 1px solid; font-size:16px; color:#113597; font-weight:bold; padding-bottom:5px; margin:10px 0px">Registrar Estudiante</div>
<form id="formconsulta" name="formconsulta" action="index.php?c=seguridad&amp;m=registrar_usuario" method="post" onSubmit="return validar_formulario();" >
	(*):Campos Obligatorios
	<input type='hidden' name='tipo_persona' id="tipo_persona" value='0' />
	<input type='hidden' name='modo' id="modo" value='admin' />
	<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border:#CCCCCC 1px solid;background-repeat:repeat-x; background-image:url(<?php echo DIR_IMAGENES?>/fondotabla.gif)">
	  <tr>
	    <td width="18"></td>
	    <td height="8"></td>
	    <td></td>
	  </tr>
	  
	  <tr>
	    <td>&nbsp;</td>
	    <td height="28">Nombre de Usuario(*):</td>
	    <td><input type="text" name="txtuser_name" id="txtuser_name" class="text1" style="height:22px; width:95%" /></td>
	  </tr>
	  <tr>
	    <td>&nbsp;</td>
	    <td height="28">Contraseña(*):</td>
	    <td><input type="password" name="txtpassword" id="txtpassword" class="text1" style="height:22px; width:95%" /></td>
	  </tr>
	  <tr>
	    <td>&nbsp;</td>
	    <td height="28">Confirmar contraseña(*):</td>
	    <td><input type="password" name="txtpassword2" id="txtpassword2" class="text1" style="height:22px; width:95%" /></td>
	  </tr>   
	  <tr>
	    <td width="18"></td>
	    <td width="144" height="28">Nombres(*):</td>
	    <td width="373"><input type="text" name="txtnombre" id="txtnombre" class="text1" style="height:22px; width:95%" /></td>
	  </tr>
	  <tr>
	    <td>&nbsp;</td>
	    <td height="28">Apellidos(*):</td>
	    <td><input type="text" name="txtapellido" id="txtapellido" class="text1" style="height:22px; width:95%" /></td>
	  </tr>
	  <tr>
	    <td>&nbsp;</td>
	    <td height="28">Sexo:</td>
	    <td>
	    	<select id="sexo_persona" name="sexo_persona">
	    		<option value="1">Masculino</option>
	    		<option value="0">Femenino</option>
	    	</select> 	
	    </td>
	  </tr>
	  <tr>
	    <td>&nbsp;</td>
	    <td height="28">Correo(*):</td>
	    <td><input type="text" name="txtcorreo" id="txtcorreo" class="text1" style="height:22px; width:95%" /></td>
	  </tr>
	  
	  <tr>
	    <td>&nbsp;</td>
	    <td height="28">Dirección:</td>
	    <td><input type="text" name="txtdireccion" id="textfield9" class="text1" style="height:22px; width:95%" /></td>
	  </tr>
	  <tr>
	    <td>&nbsp;</td>
	    <td height="28">Telefono:</td>
	    <td><input type="text" name="txttelefono" id="textfield4" class="text1" style="height:22px; width:95%" /></td>
	  </tr>
	  <tr>
	    <td>&nbsp;</td>
	    <td height="31">Celular:</td>
	    <td><input type="text" name="txtcelular" id="textfield10" class="text1" style="height:22px; width:95%" /></td>
	  </tr>
	  <tr>
	    <td>&nbsp;</td>
	    <td height="31">Fecha Nacimiento:</td>
	    <td><input type="text" name="txtnacimiento" id="txtnacimiento" class="text1" value="<?php echo date('Y-m-d')?>" style="height:22px; width:20%" readonly /></td>
	  </tr>
	  <tr id="field_centro_estudios">
	    <td>&nbsp;</td>
	    <td height="28">Centro Estudios:</td>
	    <td>
	    	<select id="centro_estudios" name="centro_estudios">
	    		<?php foreach ($centros as $centro):?>
	    			<option value="<?php echo $centro->id_centro_estudios?>"><?php echo $centro->nombre_centro?></option>
	    		<?php endforeach;?>
	    	</select> 	
	    </td>
	  </tr>
	  <tr id="field_carrera">
	    <td>&nbsp;</td>
	    <td height="28">Carrera:</td>
	    <td>
	    	<select id="carrera" name="carrera">
	    		<?php foreach ($carreras as $carrera):?>
	    			<option value="<?php echo $carrera->id_carrera?>"><?php echo $carrera->nombre_carrera?></option>
	    		<?php endforeach;?>
	    	</select> 	
	    </td>
	  </tr>
	  <tr id="field_ciclo">
	    <td>&nbsp;</td>
	    <td height="28">Ciclo:</td>
	    <td>
	    	<select id="ciclo" name="ciclo">
	    		<option value="1">1</option>
	    		<option value="2">2</option>
	    		<option value="3">3</option>
	    		<option value="4">4</option>
	    		<option value="5">5</option>
	    		<option value="6">6</option>
	    		<option value="7">7</option>
	    		<option value="8">8</option>
	    		<option value="9">9</option>
	    		<option value="10">10</option>
	    	</select> 	
	    </td>
	  </tr>
	  <tr id="field_codigo">
	    <td>&nbsp;</td>
	    <td height="31">Cod. Estudiante:</td>
	    <td><input type="text" name="txtcod_estudiante" id="txtcod_estudiante" class="text1" style="height:22px; width:95%" /></td>
	  </tr>
	 
	  <tr>
	    <td>&nbsp;</td>
	    <td height="31">&nbsp;</td>
	    <td><input type="image" src="<?php echo DIR_IMAGENES?>/registrarse.gif" width="119" height="23" style="padding:0px; border:0px" /></td>
	  </tr>
	  <tr>
	    <td>&nbsp;</td>
	    <td height="18">&nbsp;</td>
	    <td>&nbsp;</td>
	  </tr>
	  
	</table>
</form>